package oop2;

/**
 * @author oldliu
 * @since 1.0
 */
public class Teacher {
    public int calc(int java,int c){
        if(java<80)
            java=80;//给java涨粉
        System.out.println("开始算分："+java+","+c);
        int avg=java+c;
        return avg/2;
    }

    public int calc2(Student s){
        if(s.java<80)
            s.java=80;
        s.show();
        int avg=(s.java+s.c)/2;
        return avg;
    }
    //多个学生算java平均分
    public int calcJAvaAvg(Student []stus){
        int sum=0;
        for (Student s1:stus){
            sum+=s1.java;
        }
        return sum/stus.length;
    }
}
